module app.response.ResultMsg3;

import std.json;
import hunt.serialization.JsonSerializer;
import app.utils.RespCodeEnun;

/**
* 响应消息类，带total总数，文章分页使用
*/
public class ResultMsg3
{
    @JsonProperty("code")
    RespCodeEnun code;
    string msg;
    long total;
    JSONValue data;

    this()
    {
    }

    this(RespCodeEnun code, string msg)
    {
        this.code = code;
        this.msg = msg;
    }

    this(RespCodeEnun code, string msg, long total)
    {
        this.code = code;
        this.msg = msg;
        this.total = total;
    }

    this(RespCodeEnun code, string msg, JSONValue data)
    {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    this(RespCodeEnun code, string msg, long total, JSONValue data)
    {
        this.code = code;
        this.msg = msg;
        this.total = total;
        this.data = data;
    }

    this(RespCodeEnun code, string msg, string[string] data)
    {
        this(code, msg, JSONValue(data));
    }
}
